package edu.hunau.cxb19.basic.class02;

/**
 *
 * @author hb
 *
 *         2020-02-10 16:08:05
 */
public class MathDemo {

	public static void main(String[] args) {
		int a = 3;
		double b = 2;
		double c = a / b;
		System.out.println(c);//1.5
	
		byte b1=1;
		byte b2=2;
		byte b3=(byte)(b1+b2);//1. byte底层采用int类型计算，2. 结果应该为int类型

		System.out.println(10%3);//取余
		System.out.println(9%3);//取余
		System.out.println(8%3);//取余
		System.out.println(7%3);//取余
		System.out.println(6%3);//取余
		System.out.println(5%3);//取余
		
		System.out.println(3+4+" hello world");//7 hello world
		System.out.println("Hello"+3+4);//Hello34
		
		// System.out.println(2/0);
		System.out.println(2.0/0);//Infinity
		
		System.out.println(5%-2);
		System.out.println(-5%2);
		
		int data=123;
		System.out.println("个位的值："+3);
		System.out.println("十位的值："+3);
		System.out.println("百位的值："+3);
		
		int max=0x7fff_ffff;
		System.out.println(max);//2147483647
		long m1=2147483648l;//必须使用l或者L明确位long类型
	}
}
